package com.example.gg.gitdemo;

import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;
import android.widget.Toast;

import org.androidannotations.annotations.AfterInject;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.ViewById;
import org.simple.eventbus.EventBus;
import org.simple.eventbus.Subscriber;

@EActivity(R.layout.activity_reply)
public class ReplyActivity extends AppCompatActivity {

    private EventBus eventBus = EventBus.getDefault();

    @ViewById
    TextView tvReply;

    @AfterInject
    public void init(){
        eventBus.register(this);
    }

    @Subscriber
    public void showMsg(String msg){
        Toast.makeText(this,msg,Toast.LENGTH_SHORT).show();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        eventBus.unregister(this);
    }
}
